<?php
namespace Budget\BudgetBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

class Expenses
{
//    /**
//    * @ORM\ManyToMany(targetEntity="Expense", cascade={"persist"})
//    */
    protected $expenses;

    public function __construct()
    {
        $this->expenses = new ArrayCollection();
    }

    public function getExpenses()
    {
        return $this->expenses;
    }
    
    public function addExpense(Expense $expense)
    {
        //$expense->addExpenses($this);
        $this->expenses->add($expense);
    }

    public function removeExpense(Expense $expense)
    {
        $this->expenses->removeElement($expense);
    }
}